package io.xiyou.xmq.core;

public class XmqProducer {

    private XmqBroker broker;

    public XmqProducer(XmqBroker broker) {
        this.broker = broker;
    }

    public boolean send(String topic, XmqMessage message) {
        Xmq kmq = this.broker.findKmq(topic);
        if (null == kmq) throw new RuntimeException("Topic[" + topic + "] doesn't exist.");
        return kmq.send(message);
    }
}
